﻿using Microsoft.Xna.Framework;
using Terraria;
using Terraria.GameContent.Creative;
using Terraria.ID;
using Terraria.ModLoader;

namespace EAS.Content.Items
{
    public class RainbowAcorn : ModItem
    {
        public override void SetStaticDefaults()
        {
            CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
        }
        public override void AddRecipes()
        {
            Recipe modRecipe = Recipe.Create(Type, 1);
            modRecipe.AddIngredient(ItemID.Acorn, 1);
            modRecipe.AddIngredient(ItemID.RainbowMossBlock, 10);
            modRecipe.AddTile(TileID.TinkerersWorkbench);
            modRecipe.AddCondition(Condition.InExpertMode);
            modRecipe.Register();
        }
        public override void SetDefaults()
        {
            Item.width = 20;
            Item.height = 20;
            Item.accessory = true;
            Item.value = Item.sellPrice(0, 2, 10, 10);
            Item.rare = ItemRarityID.Expert;
            Item.expert = true;
        }
        public override Color? GetAlpha(Color lightColor)
        {           
            return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB);
        }
        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            player.hasRainbowCursor = true;
            player.accRunSpeed += 0.07f;
            player.statManaMax2 += (int)(player.statManaMax2 * 0.07f);
            player.statLifeMax2 += (int)(player.statLifeMax2 * 0.07f);
            player.statDefense += (int)(player.statDefense * 0.07f);
        }
    }
}
